{extend name="public/base" /}

{block name="title"} 后臺首頁-{$title}{/block}

{block name="style"}
{/block}

{block name="main"}

        <!-- Pages Table Row Start -->
        <div class="row">
            <div class="col-md-12">
                <div class="page-box">
                    <ul class="nav nav-tabs" style="margin-bottom:16px;">
                        <li role="presentation" class="active"><a href="/<?=$routeName?>_lst"><?=$config['tableCnName']?>列表</a></li>
                        <li role="presentation"><a href="/<?=$routeName?>_add">新增<?=$config['tableCnName']?></a></li>
                    </ul>

                    <div class="form-wrap label-right form-layout-page">
                        <form>
                            <?php if(!empty($config['search'])){ foreach($config['search'] as $k=>$v){?>
                            <?php if($v['type'] == 'text'){?>
                            <div class="form-group col-sm-4">
                                <div class="row">
                                    <div class="col-md-4">
                                        <label class="control-label"><?=$v['comment']?>:</label>
                                    </div>
                                    <div class="col-md-8">
                                        <input type="text" name="<?=$v['field']?>" class="form-control">
                                    </div>
                                </div>
                            </div>
                            <?php }else if($v['type'] == 'select'){?>

                            <div class="form-group col-sm-4">
                                <div class="row">
                                    <div class="col-md-4">
                                        <label class="control-label"><?=$v['comment']?>:</label>
                                    </div>
                                    <div class="col-md-8">
                                        <div class="form-gender">
                                            <div class="form-group form-radio">
                                                <select class="form-control" name="<?=$v['field']?>">
                                                    <?php echo '
                                                    <?php
                                                       if(input('.'\'param.'.$v['field'].'\''.')){
                                                            $sel = '.'\'selected="selected"\''.';
                                                       }else{
                                                            $sel = '.'\' \''.';
                                                       }
                                                    ?>';

                                                    ?>

                                                    <option>1</option>
                                                    <option>2</option>
                                                    <option>3</option>
                                                    <option>4</option>
                                                    <option>5</option>
                                                    <option>6</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php } ?>
                            <?php }} ?>

                            <div class="form-group col-sm-4">
                                <div class="row">
                                    <div class="col-md-12">
                                        <button type="submit" class="btn btn-info">搜索</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>


                    <div class="table-responsive" style="clear:both;">
                        <table id="page-list" class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <?php foreach($config['form_fields'] as $k=>$v){?>
                                <?php if($v['is_visible'] == 1){?>
                                <th><?=$v['text']?></th>
                                <?php } ?>
                                <?php } ?>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            <?php echo '<?php if(!empty($data)){foreach($data as $k=>$v): ?>'?>
                            <tr>
                                <td><?php echo '<?php echo $v[\''.$pri_key.'\']?>' ?></td>
                            <?php foreach($config['form_fields'] as $k=>$v): ?>
                                <?php if($v['is_visible'] == 1){?>
                                    <td><?php echo '<?php echo $v[\''.$k.'\']?>'?></td>
                                <?php } ?>
                            <?php endforeach;?>

                                <td>
                                    <a href="#" class="page-table-success" data-toggle="tooltip" title="查看" onclick="C.iframe('<?php echo '<?php echo \''.$routeName.'_view?'.$pri_key.'=\'.$v[\''.$pri_key.'\']?>'?>');"><i class="fa fa-eye"></i></a>
                                    <a href="<?php echo '<?php echo \''.$routeName.'_edit?'.$pri_key.'=\'.$v[\''.$pri_key.'\']?>'?>" class="page-table-info" data-toggle="tooltip" title="編輯"><i class="fa fa-pencil"></i></a>
                                    <a href="javascript:C.confirm('确定要删除','<?php echo '<?php echo \''.$routeName.'_del?'.$pri_key.'=\'.$v[\''.$pri_key.'\']?>'?>');" class="page-table-danger" data-toggle="tooltip" title=""><i class="fa fa-trash"></i></a>
                                </td>
                            </tr>

                            <?php echo '<?php endforeach; } ?>'?>


                            </tbody>
                        </table>
                    </div>
                    <!--
                    <nav aria-label="Page navigation" class="text-right">
                        <ul class="pagination">
                            <li>
                                <a href="#" aria-label="Previous">
                                    <i class="fa fa-angle-double-left"></i>
                                </a>
                            </li>
                            <li><a href="#">1</a></li>
                            <li class="active"><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">5</a></li>
                            <li>
                                <a href="#" aria-label="Next">
                                    <i class="fa fa-angle-double-right"></i>
                                </a>
                            </li>
                        </ul>
                    </nav>
                    -->
                </div>


            </div>
        </div>

        <!-- End Pages Table Row -->

{/block}